package com.ming.elm.dao;

import java.util.List;

import com.ming.elm.po.DeliveryAddress;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DeliveryAddressDao {

	@Select("select * from deliveryaddress where userId = #{userId}")
	public List<DeliveryAddress> listDeliveryAddressByUserId(String userId) throws Exception;
	@Insert("insert into deliveryaddress(contactName,contactSex,contactTel,address,userId)" +
			"values (#{contactName},#{contactSex},#{contactTel},#{address},#{userId})")
	public int saveDeliveryAddress(DeliveryAddress deliveryAddress) throws Exception;
	@Select("select * from deliveryaddress where daId = #{daId}")
	public DeliveryAddress getDeliveryAddressById(Integer daId) throws Exception;

	public int updateDeliveryAddress(DeliveryAddress deliveryAddress) throws Exception;

	@Delete("delete from deliveryaddress where daId = #{daId}")
	public int removeDeliveryAddress(Integer daId) throws Exception;
}
